#ifndef _MOTION_DTC_H_
#define _MOTION_DTC_H_

#ifndef abs
#define abs(a) (((a) < 0) ? -(a) : (a))
#endif

#define MD_BLOCK_X_NUM      (5)
#define MD_BLOCK_Y_NUM      (5)

typedef struct {
	int mvWidth;
	int mvHeight;
	int ulMvXTh;
	int ulMvYTh;
	int ulCntTh;
	int mvX_max;	
	int mvY_max;	
} MOTION_DETECT_CONFIG;

typedef enum {
	MOTION_NO       = 0,
	MOTION_DETECT   = 1
} MD_RESULT;

void MD_Initialize(int mvWidth, int mvHeight, int mvX_max, int mvY_max);
void MD_GetMBRngBd(MMP_USHORT *usWidth, MMP_USHORT *usHeight);
MMP_USHORT MD_GetMDAreaMaskCount(void);
void MD_SetMDThCntBySensitivity(MMP_USHORT usSenRange);
void MD_SetMvThBySensitivity(MMP_USHORT usSenRange);
MMP_USHORT MD_GetMDSensitivity(void);
void MD_SetMDSensitivity(MMP_USHORT usRange);
void MD_SetAreaMask(MMP_USHORT usMbX, MMP_USHORT usMbY, MMP_BOOL bEnable);
void MD_SetAllAreaMask(MMP_BOOL bEnable);
void MD_SetMvThreshold(int ulMvXTh, int ulMvYTh);
void MD_GetMvThreshold(int *ulMvXTh, int *ulMvYTh);
void MD_SetCntTh(int ulCntTh);
void MD_GetCntTh(int *ulCntTh);
MD_RESULT MD_Execute(MMP_BOOL isIFrame);

#endif
